﻿using AutoMapper;

namespace Fortunate.API.AppCode
{
    /// <summary>
    ///  配置构造函数，用来创建关系映射
    /// </summary>
    public class AutoMapperProfile : Profile
    {
        //https://blog.csdn.net/catshitone/article/details/109840926#:~:text=%E3%80%90C%23%E3%80%91%E4%BD%BF%E7%94%A8AutoMapper-%E7%9C%8B%E8%BF%99%E7%AF%87%E5%B0%B1%E5%A4%9F%E4%BA%86%201%200.%20%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B%20%E9%A6%96%E5%85%88%EF%BC%8C%E9%85%8D%E7%BD%AE%E6%98%A0%E5%B0%84%E5%85%B3%E7%B3%BB%20...%202%201.%E5%B8%B8%E8%A7%81%E9%85%8D%E7%BD%AE,%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2%20%28%E5%8F%AF%E9%92%88%E5%AF%B9%E6%89%80%E6%9C%89%E7%9A%84maps%E7%94%9F%E6%95%88%29%20%E5%BD%93%E4%BB%8E%E5%8F%AF%E7%A9%BA%E7%B1%BB%E5%9E%8B%E4%B8%8E%E4%B8%8D%E5%8F%AF%E7%A9%BA%E7%B1%BB%E5%9E%8B%E7%9B%B8%E4%BA%92%E8%BD%AC%E6%8D%A2%E6%97%B6%EF%BC%8C%E5%BD%93%20string%20%E4%B8%8E%20int%20%E7%AD%89%E8%BD%AC%E6%8D%A2%E6%97%B6%EF%BC%8C%E5%B0%B1%E9%9C%80%E8%A6%81%E8%87%AA%E5%AE%9A%E4%B9%89%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2%E3%80%82%20        public AutoMapperProfile()
        public AutoMapperProfile()
        {
            //第一个参数是源对象，第二个参数是目的对象
            CreateMap<ViewModel.UserModule.UsersList, Application.Entities.Users>();
            CreateMap<Application.Entities.Users, ViewModel.UserModule.UsersList>();

            CreateMap<ViewModel.UserModule.UsersModel, Application.Entities.Users>();
            CreateMap<Application.Entities.Users, ViewModel.UserModule.UsersModel>();

            CreateMap<ViewModel.ExeclModule.ExeclList, Application.Entities.ImportExcel>();
            CreateMap<Application.Entities.ImportExcel, ViewModel.ExeclModule.ExeclList>();
        }

    }
}
